<template>
  <div id="reagentManage">
    <el-card class="box-card" style="margin:15px">
      <el-form
        ref="basicForm"
        :rules="basicDataRules"
        :inline="true"
        :model="basicData.model"
        class="demo-form-inline"
        size="small"
      >
        <el-row>
          <el-col :span="6">
            <el-form-item label="批号:" prop="batchNumber">
              <el-input size="mini" v-model="basicData.model.batchNumber" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="实验项目:" prop="experimentCode.key">
              <el-select size="mini" v-model="basicData.model.experimentCode.key" placeholder="全部">
                <el-option label="PHE" value="PHE" />
                <el-option label="TSH" value="TSH" />
                <el-option label="17_a_0HP" value="17_a_0HP" />
                <el-option label="G6PD" value="G6PD" />
                <el-option label="MSMS" value="MSMS" />
                <el-option label="GAL" value="GAL" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="试剂类型:" prop="consumablesType.key">
              <el-select
                size="mini"
                v-model="basicData.model.consumablesType.key"
                placeholder="请选择"
              >
                <el-option
                  v-for="(item, key, index) in dicts.CONSUMABLES_TYPE"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="状态类型:" prop="consumablesStatus.key">
              <el-select
                size="mini"
                v-model="basicData.model.consumablesStatus.key"
                placeholder="请选择"
              >
                <el-option
                  v-for="(item, key, index) in dicts.CONSUMABLES_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="24">
            <div style="margin-top:20px">
              <el-select size="mini" slot="prepend" v-model="rksj" placeholder="入库日期">
                <el-option label="入库日期" value="1" />
              </el-select>
              <el-date-picker
                size="mini"
                v-model="dateTime"
                type="daterange"
                value-format="yyyy-MM-dd"
                style="width:500px"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
            </div>
          </el-col>
        </el-row>
      </el-form>
      <div class="buttom" style="margin-top:7px">
        <el-button
          type="primary"
          size="small"
          style="width:100px"
          icon="el-icon-search"
          @click="getList(basicData)"
        >查询</el-button>
        <el-button size="small" @click="onSubmit('reset')">清空</el-button>
      </div>
    </el-card>
    <el-card class="box-card" style="margin:5px 15px;">
      <div style="margin-bottom:10px">
        <el-button size="small" type="primary" icon="el-icon-document-add" @click="ctAdd">
          <!-- 传统新增 -->
          新增
        </el-button>
        <!-- <el-button
          size="small"
          type="primary"
          icon="el-icon-document-add"
          @click="clAdd"
        >
          串联新增
        </el-button>-->
      </div>
      <el-table
        :data="tableData"
        style="width: 100%;padding:5px;"
        :header-cell-style="{
          background: '#333333',
          color: '#ffffff',
          textAlign: 'center'
        }"
      >
        <el-table-column align="center" type="index" width="65" />
        <el-table-column align="center" prop="batchNumber" label="批号" width="180" />
        <el-table-column align="center" prop="consumablesType.data" label="类型" width="90" />
        <el-table-column align="center" prop="consumablesStatus.data" label="状态" width="90" />
        <el-table-column align="center" prop="gross" sortable label="总量" width="90" />
        <el-table-column align="center" prop="margin" label="余量" width="90" />
        <el-table-column
          align="center"
          prop="experimentCode.data"
          label="项目"
          width="120"
          show-overflow-tooltip
        />
        <el-table-column
          align="center"
          prop="warehouseTime"
          label="入库日期"
          width="110"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <span>{{ scope.row.warehouseTime?scope.row.warehouseTime.substr(0, 10):'' }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          prop="behindTime"
          label="有效日期"
          width="110"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <span>{{ scope.row.behindTime?scope.row.behindTime.substr(0, 10):'' }}</span>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="primary"
              style="background:#2669F3"
              @click="clickEdit(scope.row)"
            >修改</el-button>
            <el-button
              size="mini"
              type="primary"
              style="background:#2669F3"
              @click="clickDelete(scope.row)"
            >删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        :current-page="basicData.current"
        :page-size="basicData.size"
        :total="total"
        layout="slot,total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      >
        <span
          v-if="tableData.length > 0"
          style="font-weight: 400;color:#606266"
        >已选中{{ tableData.length }}条，</span>
      </el-pagination>
    </el-card>

    <!-- 传统新增 -->
    <el-dialog :visible.sync="ctAddShow" width="65%" center custom-class="print-dialog">
      <span
        slot="title"
        class="dialog-title"
        style="font-size: 18px;font-weight: 400;color: #FFFFFF;"
      >传统新增</span>

      <el-form
        ref="basicForm"
        :rules="addOrEditDataRules"
        :inline="true"
        :model="ctAddData"
        class="demo-form-inline"
        size="small"
        label-width="120px"
      >
        <div style="margin-top:10px;">
          <el-row>
            <el-col :span="24">
              <el-form-item label="类型:" prop="consumablesType.key">
                <el-select size="mini" v-model="ctAddData.consumablesType.key" style="width:300px">
                  <el-option
                    v-for="(item, key, index) in dicts.CONSUMABLES_TYPE"
                    :key="index"
                    :label="item"
                    :value="key"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="批号:" prop="batchNumber">
                <el-input
                  style="width:300px"
                  size="mini"
                  v-model="ctAddData.batchNumber"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="名称:" prop="name">
                <el-input
                  style="width:300px"
                  size="mini"
                  v-model="ctAddData.name"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="入库日期:" prop="warehouseTime">
                <el-date-picker
                  style="width:300px"
                  size="mini"
                  v-model="ctAddData.warehouseTime"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="过期日期:" prop="behindTime">
                <el-date-picker
                  style="width:300px"
                  size="mini"
                  v-model="ctAddData.behindTime"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="总量:" prop="gross">
                <el-input
                  style="width:300px"
                  size="mini"
                  type="number"
                  v-model.number="ctAddData.gross"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="余量:" prop="margin">
                <el-input
                  style="width:300px"
                  size="mini"
                  type="number"
                  v-model.number="ctAddData.margin"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="状态:" prop="consumablesStatus.key">
                <el-radio-group v-model="ctAddData.consumablesStatus.key">
                  <el-radio
                    v-for="(item, key, index) in dicts.CONSUMABLES_STATUS"
                    :key="index"
                    :label="key"
                  >{{ item }}</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-row id="more-row">
                <el-col id="shiyan" :span="24" class="more-col">
                  <el-form-item label="实验项目:" prop="experimentCode.key" class="projectIdList">
                    <el-radio-group
                      v-model="ctAddData.experimentCode.key"
                      @change="experimentCodeChanage"
                    >
                      <el-radio
                        v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                        :key="index"
                        :label="key"
                      >{{ item }}</el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-col>
            <div v-for="(item, key, index) in IndicatorList">
              <!-- 靶标 -->
              <el-col :span="24">
                <div
                  v-if="
                    key &&
                      ctAddData.experimentCode.key != '' &&
                      ctAddData.consumablesType.key != 'reagent' &&
                      ctAddData.consumablesType.key != ''
                  "
                  style="width:100%;background: rgba(24, 143, 242, 0.2);padding: 5.5px;margin: 8px 0px;font-size: 14px;color: rgba(0, 0, 0, 0.85);"
                >{{ key }}</div>
              </el-col>
              <div
                v-if="
                  key &&
                    ctAddData.experimentCode.key != '' &&
                    ctAddData.consumablesType.key != 'reagent' &&
                    ctAddData.consumablesType.key != ''
                "
              >
                <el-col :span="24">
                  <el-col :span="4">
                    <el-form-item label="低 靶值:" label-width="130px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].targetValue"
                        @blur="blurDCount(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].sdValue"
                        @blur="blurDSd(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="CV:" label-width="70px">
                      <el-input
                        style="width:68px"
                        size="mini"
                        v-model="IndicatorList[key][0].cvValue"
                        placeholder="输入"
                      />%
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="+2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].plus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="-2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].minus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="24">
                  <el-col :span="4">
                    <el-form-item label="中 靶值:" label-width="130px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].targetValue"
                        @blur="blurZCount(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].sdValue"
                        @blur="blurZSd(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="CV:" label-width="70px">
                      <el-input
                        style="width:68px"
                        size="mini"
                        v-model="IndicatorList[key][1].cvValue"
                        placeholder="输入"
                      />%
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="+2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].plus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="-2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].minus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="24">
                  <el-col :span="4">
                    <el-form-item label="高 靶值:" label-width="130px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].targetValue"
                        @blur="blurGCount(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].sdValue"
                        @blur="blurGSd(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="CV:" label-width="70px">
                      <el-input
                        style="width:68px"
                        size="mini"
                        v-model="IndicatorList[key][2].cvValue"
                        placeholder="输入"
                      />%
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="+2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].plus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="-2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].minus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                </el-col>
              </div>
            </div>
          </el-row>
        </div>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          style="padding: 6px 19px;"
          @click="onSubmit('seave')"
        >保存</el-button>
      </span>
    </el-dialog>

    <!-- 串联新增 -->
    <el-dialog :visible.sync="clAddShow" width="65%" center custom-class="print-dialog">
      <span
        slot="title"
        class="dialog-title"
        style="font-size: 18px;font-weight: 400;color: #FFFFFF;"
      >串联新增</span>

      <el-form
        ref="basicForm"
        :rules="addOrEditDataRules"
        :inline="true"
        :model="clAddData"
        class="demo-form-inline"
        size="small"
        label-width="120px"
      >
        <div style="margin-top:10px;">
          <el-row>
            <el-col :span="24">
              <el-form-item label="类型:" prop="consumablesType.key">
                <el-select size="mini" v-model="clAddData.consumablesType.key" style="width:300px">
                  <el-option
                    v-for="(item, key, index) in dicts.CONSUMABLES_TYPE"
                    :key="index"
                    :label="item"
                    :value="key"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="批号:" prop="batchNumber">
                <el-input
                  style="width:300px"
                  size="mini"
                  v-model="clAddData.batchNumber"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="名称:" prop="name">
                <el-input
                  style="width:300px"
                  size="mini"
                  v-model="clAddData.name"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="入库日期:" prop="warehouseTime">
                <el-date-picker
                  style="width:300px"
                  size="mini"
                  v-model="clAddData.warehouseTime"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="过期日期:" prop="behindTime">
                <el-date-picker
                  style="width:300px"
                  size="mini"
                  v-model="clAddData.behindTime"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="总量:" prop="gross">
                <el-input
                  style="width:300px"
                  size="mini"
                  type="number"
                  v-model.number="clAddData.gross"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="余量:" prop="margin">
                <el-input
                  style="width:300px"
                  size="mini"
                  type="number"
                  v-model.number="clAddData.margin"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="状态:" prop="consumablesStatus.key">
                <el-radio-group v-model="clAddData.consumablesStatus.key">
                  <el-radio
                    v-for="(item, key, index) in dicts.CONSUMABLES_STATUS"
                    :key="index"
                    :label="key"
                  >{{ item }}</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-row id="more-row">
                <el-col id="shiyan" :span="24" class="more-col">
                  <el-form-item label="实验项目:" prop="experimentCode.key" class="projectIdList">
                    <el-radio-group
                      v-model="clAddData.experimentCode.key"
                      @change="experimentCodeChanage"
                    >
                      <el-radio
                        v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                        :key="index"
                        :label="key"
                      >{{ item }}</el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-col>
            <el-col
              :span="24"
              v-if="
                clAddData.consumablesType.key &&
                  clAddData.consumablesType.key != 'reagent'
              "
            >
              <el-row id="more-row">
                <el-form-item label="类型:" prop="indicatorType.key">
                  <el-radio-group v-model="clAddData.indicatorType.key">
                    <el-radio
                      v-for="(item, key, index) in dicts.INDICATOR_TYPE"
                      :key="index"
                      :label="key"
                    >{{ item }}</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-row>
            </el-col>
            <div v-for="(item, key, index) in IndicatorList">
              <!-- 靶标 -->
              <el-col :span="24">
                <div
                  v-if="
                    key &&
                      clAddData.experimentCode.key != '' &&
                      clAddData.consumablesType.key != 'reagent' &&
                      clAddData.consumablesType.key != '' &&
                      clAddData.indicatorType.key != '' &&
                      clAddData.indicatorType.key != 'derive'
                  "
                  style="width:100%;background: rgba(24, 143, 242, 0.2);padding: 5.5px;margin: 8px 0px;font-size: 14px;color: rgba(0, 0, 0, 0.85);"
                >{{ key }}</div>
              </el-col>
              <div
                v-if="
                  key &&
                    clAddData.experimentCode.key != '' &&
                    clAddData.consumablesType.key != 'reagent' &&
                    clAddData.consumablesType.key != '' &&
                    clAddData.indicatorType.key != '' &&
                    clAddData.indicatorType.key != 'derive'
                "
              >
                <el-col :span="24">
                  <el-col :span="4">
                    <el-form-item label="低 靶值:" label-width="130px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].targetValue"
                        @blur="blurDCount(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].sdValue"
                        @blur="blurDSd(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="CV:" label-width="70px">
                      <el-input
                        style="width:68px"
                        size="mini"
                        v-model="IndicatorList[key][0].cvValue"
                        placeholder="输入"
                      />%
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="+2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].plus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="-2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].minus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="24">
                  <el-col :span="4">
                    <el-form-item label="中 靶值:" label-width="130px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].targetValue"
                        @blur="blurZCount(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].sdValue"
                        @blur="blurZSd(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="CV:" label-width="70px">
                      <el-input
                        style="width:68px"
                        size="mini"
                        v-model="IndicatorList[key][1].cvValue"
                        placeholder="输入"
                      />%
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="+2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].plus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="-2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].minus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="24">
                  <el-col :span="4">
                    <el-form-item label="高 靶值:" label-width="130px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].targetValue"
                        @blur="blurGCount(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].sdValue"
                        @blur="blurGSd(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="CV:" label-width="70px">
                      <el-input
                        style="width:68px"
                        size="mini"
                        v-model="IndicatorList[key][2].cvValue"
                        placeholder="输入"
                      />%
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="+2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].plus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="-2SD:" label-width="70px">
                      <el-input
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].minus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                </el-col>
              </div>
            </div>
          </el-row>
        </div>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          style="padding: 6px 19px;"
          @click="onSubmit('seaveCl')"
        >保存</el-button>
      </span>
    </el-dialog>

    <!-- 修改 -->
    <el-dialog :visible.sync="editShow" width="65%" center custom-class="print-dialog">
      <span
        slot="title"
        class="dialog-title"
        style="font-size: 18px;font-weight: 400;color: #FFFFFF;"
      >传统修改</span>

      <el-form
        ref="basicForm"
        :rules="addOrEditDataRules"
        :inline="true"
        :model="editData"
        class="demo-form-inline"
        size="small"
        label-width="120px"
      >
        <div style="margin-top:10px;">
          <el-row>
            <el-col :span="24">
              <el-form-item label="类型:" prop="consumablesType.key">
                <el-select
                  disabled
                  size="mini"
                  v-model="editData.consumablesType.key"
                  style="width:300px"
                >
                  <el-option
                    v-for="(item, key, index) in dicts.CONSUMABLES_TYPE"
                    :key="index"
                    :label="item"
                    :value="key"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="批号:" prop="batchNumber">
                <el-input
                  disabled
                  style="width:300px"
                  size="mini"
                  v-model="editData.batchNumber"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="名称:" prop="name">
                <el-input
                  disabled
                  style="width:300px"
                  size="mini"
                  v-model="editData.name"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="入库日期:" prop="warehouseTime">
                <el-date-picker
                  style="width:300px"
                  size="mini"
                  v-model="editData.warehouseTime"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="过期日期:" prop="behindTime">
                <el-date-picker
                  style="width:300px"
                  size="mini"
                  v-model="editData.behindTime"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="总量:" prop="gross">
                <el-input
                  style="width:300px"
                  size="mini"
                  v-model="editData.gross"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="余量:" prop="margin">
                <el-input
                  style="width:300px"
                  size="mini"
                  v-model="editData.margin"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="状态:" prop="consumablesStatus.key">
                <el-radio-group v-model="editData.consumablesStatus.key">
                  <el-radio
                    v-for="(item, key, index) in dicts.CONSUMABLES_STATUS"
                    :key="index"
                    :label="key"
                  >{{ item }}</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-row id="more-row">
                <el-col id="shiyan" :span="24" class="more-col">
                  <el-form-item label="实验项目:" prop="experimentCode.key" class="projectIdList">
                    <el-radio-group v-model="editData.experimentCode.key" disabled>
                      <el-radio
                        v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                        :key="index"
                        :label="key"
                      >{{ item }}</el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-col>
            <el-col
              :span="24"
              v-if="
                editData.consumablesType.key &&
                  editData.consumablesType.key != 'reagent' &&
                  editData.indicatorType.key != ''
              "
            >
              <el-row id="more-row">
                <el-form-item label="类型:" prop="indicatorType.key">
                  <el-radio-group v-model="editData.indicatorType.key" disabled>
                    <el-radio
                      v-for="(item, key, index) in dicts.INDICATOR_TYPE"
                      :key="index"
                      :label="key"
                    >{{ item }}</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-row>
            </el-col>
            <div v-for="(item, key, index) in IndicatorList">
              <!-- 靶标 -->
              <el-col :span="24">
                <div
                  v-if="
                    key &&
                      editData.experimentCode.key != '' &&
                      editData.consumablesType.key != 'reagent' &&
                      editData.consumablesType.key != '' &&
                      editData.indicatorType.key != '' &&
                      editData.indicatorType.key != 'derive'
                  "
                  style="width:100%;background: rgba(24, 143, 242, 0.2);padding: 5.5px;margin: 8px 0px;font-size: 14px;color: rgba(0, 0, 0, 0.85);"
                >{{ key }}</div>
              </el-col>
              <div
                v-if="
                  key &&
                    editData.experimentCode.key != '' &&
                    editData.consumablesType.key != 'reagent' &&
                    editData.consumablesType.key != '' &&
                    editData.indicatorType.key != '' &&
                    editData.indicatorType.key != 'derive'
                "
              >
                <el-col :span="24">
                  <el-col :span="4">
                    <el-form-item label="低 靶值:" label-width="130px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].targetValue"
                        @blur="blurDCount(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="SD:" label-width="70px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].sdValue"
                        @blur="blurDSd(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="CV:" label-width="70px">
                      <el-input
                        disabled
                        style="width:68px"
                        size="mini"
                        v-model="IndicatorList[key][0].cvValue"
                        placeholder="输入"
                      />%
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="+2SD:" label-width="70px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].plus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="-2SD:" label-width="70px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][0].minus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="24">
                  <el-col :span="4">
                    <el-form-item label="中 靶值:" label-width="130px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].targetValue"
                        @blur="blurZCount(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="SD:" label-width="70px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].sdValue"
                        @blur="blurZSd(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="CV:" label-width="70px">
                      <el-input
                        disabled
                        style="width:68px"
                        size="mini"
                        v-model="IndicatorList[key][1].cvValue"
                        placeholder="输入"
                      />%
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="+2SD:" label-width="70px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].plus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="-2SD:" label-width="70px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][1].minus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="24">
                  <el-col :span="4">
                    <el-form-item label="高 靶值:" label-width="130px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].targetValue"
                        @blur="blurGCount(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="SD:" label-width="70px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].sdValue"
                        @blur="blurGSd(IndicatorList[key])"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="CV:" label-width="70px">
                      <el-input
                        disabled
                        style="width:68px"
                        size="mini"
                        v-model="IndicatorList[key][2].cvValue"
                        placeholder="输入"
                      />%
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="+2SD:" label-width="70px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].plus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :span="5">
                    <el-form-item label="-2SD:" label-width="70px">
                      <el-input
                        disabled
                        style="width:80px"
                        size="mini"
                        v-model="IndicatorList[key][2].minus2SD"
                        placeholder="输入"
                      />
                    </el-form-item>
                  </el-col>
                </el-col>
              </div>
            </div>
          </el-row>
        </div>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          style="padding: 6px 19px;"
          @click="onSubmit('edit')"
        >保存</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { initDicts } from "@/utils/commons";
import consumableManageApi from "@/api/ConsumableManage.js";

export default {
  data() {
    return {
      // 转菊花
      loading: false,
      //入库时间占位符
      rksj: "",
      // 分页
      total: 0,
      // 是否展示更多信息
      morderShow: true,
      // 传统新增
      ctAddShow: false,
      // 串联新增
      clAddShow: false,
      // 传统修改
      editShow: false,
      // 页条数
      pageSize: 10,
      // 页数
      pageIndex: 1,
      // 表格数据
      tableData: [],
      // 时间列表
      dateTime: [],
      // 基本数据
      basicData: {
        current: 1,
        map: {},
        model: {
          batchNumber: "",
          consumablesStatus: {
            data: "",
            key: ""
          },
          consumablesType: {
            data: "",
            key: ""
          },
          experimentCode: {
            data: "",
            key: ""
          },
          indicatorType: {
            data: "",
            key: ""
          },
          warehouseTimeStartEnd: {
            end: "",
            start: ""
          }
        },
        order: "descending",
        size: 10,
        sort: "id"
      },
      // 传统新增
      ctAddData: {
        batchNumber: "",
        behindTime: "",
        consumablesStatus: {
          data: "",
          key: ""
        },
        consumablesType: {
          data: "",
          key: ""
        },
        experimentCode: {
          data: "",
          key: ""
        },
        gross: "",
        indicatorType: {
          data: "",
          key: ""
        },
        indicators: [
          {
            code: "",
            consumablesId: "",
            createTime: "",
            createUser: "",
            cvValue: 0,
            experimentCode: { key: "", data: "" },
            id: null,
            isDel: "",
            minus2SD: "",
            plus2SD: "",
            qualityScope: { key: "high", data: "" },
            sdValue: "",
            targetValue: "",
            updateTime: "",
            updateUser: ""
          },
          {
            code: "",
            consumablesId: "",
            createTime: "",
            createUser: "",
            cvValue: 0,
            experimentCode: { key: "", data: "" },
            id: null,
            isDel: "",
            minus2SD: "",
            plus2SD: "",
            qualityScope: { key: "medium", data: "" },
            sdValue: "",
            targetValue: "",
            updateTime: "",
            updateUser: ""
          },
          {
            code: "",
            consumablesId: "",
            createTime: "",
            createUser: "",
            cvValue: 0,
            experimentCode: { key: "", data: "" },
            id: null,
            isDel: "",
            minus2SD: "",
            plus2SD: "",
            qualityScope: { key: "low", data: "" },
            sdValue: "",
            targetValue: "",
            updateTime: "",
            updateUser: ""
          }
        ],
        margin: "",
        name: "",
        warehouseTime: ""
      },
      // 串联新增
      clAddData: {
        batchNumber: "",
        behindTime: "",
        consumablesStatus: {
          data: "",
          key: ""
        },
        consumablesType: {
          data: "",
          key: ""
        },
        experimentCode: {
          data: "",
          key: ""
        },
        gross: "",
        indicatorType: {
          data: "",
          key: ""
        },
        indicators: [
          {
            code: "",
            consumablesId: "",
            createTime: "",
            createUser: "",
            cvValue: 0,
            experimentCode: { key: "", data: "" },
            id: null,
            isDel: "",
            minus2SD: "",
            plus2SD: "",
            qualityScope: { key: "high", data: "" },
            sdValue: "",
            targetValue: "",
            updateTime: "",
            updateUser: ""
          },
          {
            code: "",
            consumablesId: "",
            createTime: "",
            createUser: "",
            cvValue: 0,
            experimentCode: { key: "", data: "" },
            id: null,
            isDel: "",
            minus2SD: "",
            plus2SD: "",
            qualityScope: { key: "medium", data: "" },
            sdValue: "",
            targetValue: "",
            updateTime: "",
            updateUser: ""
          },
          {
            code: "",
            consumablesId: "",
            createTime: "",
            createUser: "",
            cvValue: 0,
            experimentCode: { key: "", data: "" },
            id: null,
            isDel: "",
            minus2SD: "",
            plus2SD: "",
            qualityScope: { key: "low", data: "" },
            sdValue: "",
            targetValue: "",
            updateTime: "",
            updateUser: ""
          }
        ],
        margin: "",
        name: "",
        warehouseTime: ""
      },
      // 修改数据
      editData: {
        batchNumber: "",
        behindTime: "",
        consumablesStatus: {
          data: "",
          key: ""
        },
        consumablesType: {
          data: "",
          key: ""
        },
        experimentCode: {
          data: "",
          key: ""
        },
        gross: "",
        indicatorType: {
          data: "",
          key: ""
        },
        indicators: {},
        margin: "",
        name: "",
        warehouseTime: ""
      },
      // 校验
      basicDataRules: {
        "consumablesType.key": [
          { required: false, message: "   ", trigger: "change" }
        ],
        batchNumber: [{ required: false, message: "   ", trigger: "change" }],
        name: [{ required: false, message: "   ", trigger: "change" }],
        warehouseTime: [{ required: false, message: "   ", trigger: "change" }],
        behindTime: [{ required: false, message: "   ", trigger: "change" }],
        gross: [{ required: false, message: "   ", trigger: "change" }],
        margin: [{ required: false, message: "   ", trigger: "change" }],
        "consumablesStatus.key": [
          { required: false, message: "   ", trigger: "change" }
        ],
        "experimentCode.key": [
          { required: false, message: "   ", trigger: "change" }
        ]
      },
      addOrEditDataRules: {
        "consumablesType.key": [
          { required: true, message: "   ", trigger: "change" }
        ],
        batchNumber: [{ required: true, message: "   ", trigger: "change" }],
        name: [{ required: true, message: "   ", trigger: "change" }],
        warehouseTime: [{ required: true, message: "   ", trigger: "change" }],
        behindTime: [{ required: true, message: "   ", trigger: "change" }],
        gross: [{ required: true, message: "   ", trigger: "change" }],
        margin: [{ required: true, message: "   ", trigger: "change" }],
        "consumablesStatus.key": [
          { required: true, message: "   ", trigger: "change" }
        ],
        "experimentCode.key": [
          { required: true, message: "   ", trigger: "change" }
        ]
      },
      dicts: {
        CONSUMABLES_TYPE: {}, //耗材类型
        EXPERIMENT_CODE: {}, //项目
        INDICATOR_TYPE: {}, //衍生类型
        CONSUMABLES_STATUS: {} //耗材状态
      },
      // 质控参数
      IndicatorList: []
    };
  },
  mounted() {
    initDicts(
      [
        "CONSUMABLES_TYPE",
        "CONSUMABLES_STATUS",
        "EXPERIMENT_CODE",
        "INDICATOR_TYPE"
      ],
      this.dicts
    );
    this.getList(this.basicData);
  },
  methods: {
    // 选择项目发生改变
    experimentCodeChanage(v) {
      this.IndicatorList = {};

      let data = {
        consumablesType: {
          data: "",
          key: this.ctAddData.consumablesType.key
        },
        experimentCode: {
          data: "",
          key: v
        },
        indicatorType: {
          data: "",
          key: ""
        }
      };
      if (this.ctAddData.consumablesType.key != "reagent") {
        consumableManageApi.reagentManage
          .queryQualityIndicator(data)
          .then(res => {
            this.IndicatorList = res.data.data;
          });
      }
    },
    // 点击修改
    clickEdit(v) {
      this.editData = v;
      this.IndicatorList = {};
      let data = {
        consumablesType: v.consumablesType,
        experimentCode: v.experimentCode,
        id: v.id,
        indicatorType: { key: "", data: "" }
      };
      consumableManageApi.reagentManage
        .queryQualityIndicator(data)
        .then(res => {
          this.IndicatorList = res.data.data;
        });
      this.editShow = true;
    },
    // 删除
    clickDelete(v) {
      this.$confirm("是否删除?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        consumableManageApi.reagentManage
          .delete({ "ids[]": v.id })
          .then(res => {
            if (res.status == "200") {
              this.getList(this.basicData);
              this.$message({
                type: "success",
                message: res.statusText
              });
            } else {
              this.$message.error(res.statusText);
            }
          });
      });
    },
    // 低 靶值变动
    blurDCount(type) {
      if (type[0].sdValue && type[0].sdValue != "") {
        if (Number(type[0].targetValue) > Number(type[0].sdValue)) {
          this.blurDSd();
        } else {
          type[0].sdValue = "";
          type[0].cvValue = "";
          type[0].plus2SD = "";
          type[0].minus2SD = "";
          this.$message.error("SD值必须小于靶值");
        }
      }
    },
    // 中 靶值变动
    blurZCount(type) {
      if (type[1].sdValue && type[1].sdValue != "") {
        if (Number(type[1].targetValue) > Number(type[1].sdValue)) {
          this.blurZSd();
        } else {
          type[1].sdValue = "";
          type[1].cvValue = "";
          type[1].plus2SD = "";
          type[1].minus2SD = "";
          this.$message.error("SD值必须小于靶值");
        }
      }
    },
    // 高 靶值变动
    blurGCount(type) {
      if (type[2].sdValue && type[2].sdValue != "") {
        if (Number(type[2].targetValue) > Number(type[2].sdValue)) {
          this.blurGSd();
        } else {
          type[2].sdValue = "";
          type[2].cvValue = "";
          type[2].plus2SD = "";
          type[2].minus2SD = "";
          this.$message.error("SD值必须小于靶值");
        }
      }
    },
    // 低 SD变动
    blurDSd(type) {
      if (type[0].targetValue && type[0].targetValue != "") {
        if (Number(type[0].targetValue) > Number(type[0].sdValue)) {
          // 算cv
          type[0].cvValue = (
            (Number(type[0].sdValue) / Number(type[0].targetValue)) *
            100
          ).toFixed(2);
          // 算+2sd
          type[0].plus2SD =
            Number(type[0].sdValue) + Number(type[0].sdValue) * 2;
          // 算-2sd
          type[0].minus2SD =
            Number(type[0].sdValue) - Number(type[0].sdValue) * 2;
        } else {
          type[0].sdValue = "";
          type[0].cvValue = "";
          type[0].plus2SD = "";
          type[0].minus2SD = "";
          this.$message.error("SD值必须小于靶值");
        }
      }
    },
    // 中 SD变动
    blurZSd(type) {
      if (type[1].targetValue && type[1].targetValue != "") {
        if (Number(type[1].targetValue) > Number(type[1].sdValue)) {
          // 算cv
          type[1].cvValue = (
            (Number(type[1].sdValue) / Number(type[1].targetValue)) *
            100
          ).toFixed(2);
          // 算+2sd
          type[1].plus2SD =
            Number(type[1].sdValue) + Number(type[1].sdValue) * 2;
          // 算-2sd
          type[1].minus2SD =
            Number(type[1].sdValue) - Number(type[1].sdValue) * 2;
        } else {
          type[1].sdValue = "";
          type[1].cvValue = "";
          type[1].plus2SD = "";
          type[1].minus2SD = "";
          this.$message.error("SD值必须小于靶值");
        }
      }
    },
    // 高 SD变动
    blurGSd(type) {
      if (type[2].targetValue && type[2].targetValue != "") {
        if (Number(type[2].targetValue) > Number(type[2].sdValue)) {
          // 算cv
          type[2].cvValue = (
            (Number(type[2].sdValue) / Number(type[2].targetValue)) *
            100
          ).toFixed(2);
          // 算+2sd
          type[2].plus2SD =
            Number(type[2].sdValue) + Number(type[2].sdValue) * 2;
          // 算-2sd
          type[2].minus2SD =
            Number(type[2].sdValue) - Number(type[2].sdValue) * 2;
        } else {
          type[2].sdValue = "";
          type[2].cvValue = "";
          type[2].plus2SD = "";
          type[2].minus2SD = "";
          this.$message.error("SD值必须小于靶值");
        }
      }
    },
    // 传统新增
    ctAdd() {
      this.IndicatorList = {};
      this.ctAddShow = true;
    },
    // 串联新增
    clAdd() {
      this.clAddShow = true;
      this.IndicatorList = {};
    },
    // 获取table
    getList(data) {
      this.loading = true;
      this.basicData.model.warehouseTimeStartEnd.start =
        this.dateTime.length > 0 ? this.dateTime[0] : "";
      this.basicData.model.warehouseTimeStartEnd.end =
        this.dateTime.length > 0 ? this.dateTime[1] : "";

      consumableManageApi.reagentManage.page(data).then(res => {
        this.tableData = res.data.data.records;
        this.total = res.data.data.total;
        this.loading = false;
      });
    },
    // 点击展示与收起
    onMoreStatus() {
      this.morderShow = !this.morderShow;
    },
    // 基础信息按钮点击事件
    onSubmit(type) {
      if (type == "query") {
      } else if (type == "reset") {
        this.dateTime = "";
        this.$refs["basicForm"].resetFields();
      } else if (type == "seave") {
        this.$refs["basicForm"].validate(valid => {
          if (valid) {
            let data = {
              ...this.ctAddData,
              indicators: {
                ...this.IndicatorList
              }
            };

            consumableManageApi.reagentManage.add(data).then(res => {
              if (res.status == "200") {
                this.getList(this.basicData);
                this.ctAddShow = false;
                this.$message({
                  type: "success",
                  message: "新增成功!"
                });
                this.$refs["basicForm"].resetFields();
              } else {
                this.$message.error(res.statusText);
              }
            });
          } else {
            return false;
          }
        });
      } else if (type == "seaveCl") {
        this.$refs["basicForm"].validate(valid => {
          if (valid) {
            let data = {
              ...this.clAddData,
              indicators: {
                ...this.IndicatorList
              }
            };
            consumableManageApi.reagentManage.add(data).then(res => {
              console.log(res);
              if (res.status == "200") {
                this.getList(this.basicData);
                this.ctAddShow = false;
                this.clAddShow = false;
                this.$message({
                  type: "success",
                  message: "新增成功!"
                });
                this.$refs["basicForm"].resetFields();
              } else {
                this.$message.error(res.statusText);
              }
            });
          } else {
            return false;
          }
        });
      } else if (type == "edit") {
        this.$refs["basicForm"].validate(valid => {
          if (valid) {
            consumableManageApi.reagentManage.edit(this.editData).then(res => {
              if (res.status == "200") {
                this.getList(this.basicData);
                this.editShow = false;
                this.$message({
                  type: "success",
                  message: "修改成功!"
                });
              } else {
                this.$message.error(res.statusText);
              }
            });
          } else {
            return false;
          }
        });
      }
    },
    // 点击打印
    clickTruePrint() {
      this.handlePrintPrint();
    },
    // 点击分页
    handleSizeChange: function(val) {
      this.basicData.size = val;
      this.getList(this.basicData);
    },
    // 选择页码
    handleCurrentChange: function(currentPage) {
      this.basicData.current = currentPage;
      this.getList(this.basicData);
    }
  }
};
</script>

<style lang="less">
.flex {
  display: flex;
  align-items: center;
  justify-content: center;
}
#reagentManage {
  /*------------------------修改type=number的样式------------------------------------------------*/
  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    -webkit-appearance: none;
  }
  input[type="number"] {
    -moz-appearance: textfield;
  }

  .el-form-item__content {
    flex-direction: row;
    justify-content: start;
    align-items: center !important;
  }
  #more-row {
    #shiyan {
      .projectIdList {
        width: 100%;
        .el-form-item__content {
          width: 80%;
        }
      }
    }
    .more-col {
      .remark {
        width: 100%;
        .el-form-item__content {
          width: 90%;
        }
      }
    }
    .el-form-item {
      .el-form-item__content {
        width: 400px;
      }
    }
  }
  .buttom {
    width: 100%;
    .flex;
  }
  .el-dialog__header {
    border-bottom: 1px solid #e0e0e0;
  }
  .print-form {
    max-height: 500px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    flex-flow: wrap;
    .print-item {
      width: 50%;
      .flex;
      justify-content: flex-start;
      color: #222222;
      font-size: 15px;
      margin-top: 10px;
      .title {
        font-weight: bold;
        flex: 0.4;
      }
      .value {
        flex: 0.6;
        font-weight: bold;
        overflow-wrap: anywhere;
      }
    }
  }
  .el-dialog__footer {
    .flex;
  }
  .select-input {
    .el-form-item {
      margin: 0;
      .el-select .el-input {
        width: 100%;
      }
    }
    .flex;
    justify-content: flex-start;
    margin-bottom: 18px;
    .el-select .el-input {
      width: 110px;
    }
    .input-with-select .el-input-group__prepend {
      background-color: #fff;
    }
  }
}
</style>
